package com.rickpan.dto.chat;

import lombok.Data;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;

/**
 * 保存消息请求DTO
 */
@Data
public class SaveMessageRequest {
    
    @NotBlank(message = "消息角色不能为空")
    @Pattern(regexp = "^(user|assistant)$", message = "消息角色只能是user或assistant")
    private String role;
    
    @NotBlank(message = "消息内容不能为空")
    private String content;

    private Integer tokenCount = 0;

    // 手动添加getter方法以确保编译通过
    public String getRole() {
        return role;
    }

    public String getContent() {
        return content;
    }

    public Integer getTokenCount() {
        return tokenCount;
    }
}
